import request from "@/utils/request.js";

export const addSegmentService=(data)=>{
  return request.post('/ship_segments/addSegment',data)
}


export const getSegmentsService=(data)=>{
  return request.get('/ship_segments/getSegments',{
    params: data,
  })
}

export const updateSegmentsService = (id,data) => {
  return request.put(`/ship_segments/segmentDetail/${id}`, data);
}

export const deleteSegmentsService=(entities)=>{
  return request.post('/ship_segments/deleteSegments',{ entities })
}

/**
 * 批量导入船舶分段信息
 * @param {Array} dataList - Excel 解析后的数据数组
 */
export const importSegmentsService = (dataList) => {
  return request.post('/ship_segments/importSegments', { list: dataList });
};
